package com.cn.topAndFoot.controller;

import com.cn.common.pojo.CompanyModel;
import com.cn.common.pojo.ResultModel;
import com.cn.topAndFoot.service.EsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("es")
public class CompanyForEsController {
    @Autowired
     private EsService esService;
    @GetMapping("findAll")
    public ResultModel EsFindAll(CompanyModel companyModel, Integer page, Integer limit, String address){
        companyModel.setAddress(address);
        companyModel.setPageNum(page);
        companyModel.setPageSize(limit);
        if (address!=null){
            return esService.esFindByStr(companyModel);
        }
        return esService.esFindAll(companyModel);

    }
}
